/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package sysmodel.impl;

import java.util.Collection;

import org.eclipse.emf.common.notify.NotificationChain;

import org.eclipse.emf.common.util.EList;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;

import sysmodel.SysmodelPackage;
import sysmodel.dotNetBusinessComponent;
import sysmodel.dotNetBusinessService;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>dot Net Business Component</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link sysmodel.impl.dotNetBusinessComponentImpl#getBusinessService <em>Business Service</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class dotNetBusinessComponentImpl extends BusinessComponentImpl implements dotNetBusinessComponent {
	/**
	 * The cached value of the '{@link #getBusinessService() <em>Business Service</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getBusinessService()
	 * @generated
	 * @ordered
	 */
	protected EList<dotNetBusinessService> businessService;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected dotNetBusinessComponentImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return SysmodelPackage.Literals.DOT_NET_BUSINESS_COMPONENT;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<dotNetBusinessService> getBusinessService() {
		if (businessService == null) {
			businessService = new EObjectContainmentEList<dotNetBusinessService>(dotNetBusinessService.class, this, SysmodelPackage.DOT_NET_BUSINESS_COMPONENT__BUSINESS_SERVICE);
		}
		return businessService;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
		switch (featureID) {
			case SysmodelPackage.DOT_NET_BUSINESS_COMPONENT__BUSINESS_SERVICE:
				return ((InternalEList<?>)getBusinessService()).basicRemove(otherEnd, msgs);
		}
		return super.eInverseRemove(otherEnd, featureID, msgs);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case SysmodelPackage.DOT_NET_BUSINESS_COMPONENT__BUSINESS_SERVICE:
				return getBusinessService();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@SuppressWarnings("unchecked")
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case SysmodelPackage.DOT_NET_BUSINESS_COMPONENT__BUSINESS_SERVICE:
				getBusinessService().clear();
				getBusinessService().addAll((Collection<? extends dotNetBusinessService>)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case SysmodelPackage.DOT_NET_BUSINESS_COMPONENT__BUSINESS_SERVICE:
				getBusinessService().clear();
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case SysmodelPackage.DOT_NET_BUSINESS_COMPONENT__BUSINESS_SERVICE:
				return businessService != null && !businessService.isEmpty();
		}
		return super.eIsSet(featureID);
	}

} //dotNetBusinessComponentImpl
